import axios from 'axios'

const BASE_URL = 'http://localhost:1111' //默认的全局请求基路径
axios.defaults.baseURL = BASE_URL
const method = "get"
const params = {
    firstName: 'Fred',
    lastName: 'Flintstone'
}
function custom_axios_get(){
    axios({
        method: 'get',
        url: '/mock/login',
        params: params
    });
}
function custom_axios_post(){
    axios({
        method: 'post',
        url: '/mock/login',
        data: {
            firstName: 'Fred',
            lastName: 'Flintstone'
        }
    }).then(function(response){
        console.log(response)
    }).catch(function(error){
        console.log(error)
    });
}
export default custom_axios_get